<template>
  <view>
    <view class="box">
      <view>
        <input
          class="width84 card"
          v-model="id"
          type="idcard"
          :placeholder="messsage"
        />
      </view>
      <view class="tip_message">
        {{ tipMessage }}
      </view>
      <view class="width84">
        <button @click="submit()">确认</button>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      id: "",
	  messsage:"请输入检验单号",
      tipMessage: " ",
    };
  },
  onLoad(option) {
	  if(option.type){
		  if(option.type==1){
		  		  this.tipMessage=this.messsage="请输入检验单号";
		  }else{
			  this.tipMessage=this.messsage="请输入身份证号";
		  }
	  }
	 
    this.init();
  },

  methods: {
    init() {
      //信息初始化
    },
    submit() {
      //数据提交判断
      if (this.id == "") {
        this.tipMessage = "请输入有效检验号信息";
        return;
      }
      uni.redirectTo({
        url: "./reportList?id=" + this.id,
      });
      return;
    },
  },
};
</script>

<style>
.box {
  width: 96%;
  height: 170px;
  margin: 0 auto;
  background: #ffffff;
  margin-top: 10px;
  padding-top: 21px;
}

.box .card {
  height: 39px;
  border: 1px solid #e6e6e6;
  border-radius: 32px;
  text-indent: 1em;
}

.box .tip_message {
  text-align: center;
  font-size: 12px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 40px;
  color: #d97500;
}

.width84 button {
  background: #3692ff;
  color: #ffffff;
}
</style>
